﻿Function Assert-StorageSpacesCluster($credential,$exportDirectory,$exportFileTag)
{
    begin
    {
        Import-Module -Force ..\Windows\libFailoverClustering.psm1
        Import-Module -Force ..\Windows\libWindowsValidation.psm1
        Import-Module -Force ..\BuildDeployment\libUtilities.psm1
    }
    process
    {
        $clusterName=$_
        $clusterNodeNames=(Get-WmiObject -Namespace Root\MSCluster -Class MSCluster_Node -ComputerName $clusterName).Name

        Remove-Item -Path $exportDirectory\StorageSpacesValidation_$exportFileTag*

        ..\Windows\Get-ComputerInformation.ps1 -servers $clusterNodeNames -credential $credential -exportDirectory $exportDirectory -exportFilePrefix "StorageSpacesValidation_$exportFileTag" -featuresOrRolesToValidate @("Failover-Clustering")

        Assert-ComputerGroupFileVersionCoherency -referenceComputerName $clusterNodeNames[0] -fileVersionInventoryPath  $exportDirectory\StorageSpacesValidation_$exportFileTag`_CoreFiles_Information.csv | Export-Csv -Path $exportDirectory\StorageSpacesValidation_$exportFileTag`_Validation_CoreFiles.csv -NoTypeInformation
        Assert-ComputerGroupHotfixCoherency -referenceComputerName $clusterNodeNames[0] -hotfixInventoryPath $exportDirectory\StorageSpacesValidation_$exportFileTag`_Hotfix_Information.csv | Export-Csv -Path $exportDirectory\StorageSpacesValidation_$exportFileTag`_Validation_Hotfix.csv -NoTypeInformation

        Assert-StorageSpacesClusterWindowsUpdate -clusterName $clusterName -clusterNodeNames $clusterNodeNames
        Assert-StorageSpacesClusterNetworkDriverVersion -clusterName $clusterName
        Assert-StorageSpacesClusterBIOSVersion -clusterName $clusterName
        Assert-StorageSpacesClusterHBADriverVersion -clusterName $clusterName
    }
}

Function Assert-StorageSpacesClusterNetworkDriverVersion($clusterName)
{
    Write-Host "Asserting network driver versions in $clusterName"
}

Function Assert-StorageSpacesClusterBIOSVersion($clusterName)
{
    Write-Host "Asserting server BIOS version in $clusterName"
}

Function Assert-StorageSpacesClusterHBADriverVersion($clusterName)
{
    Write-Host "Asserting HBA driver version in $clusterName"
}